﻿Public Class MainForm

    Private Sub ShowSubForm(ByVal theForm As System.Windows.Forms.Form)
        For Each theControl As Control In PlayGround.Controls
            If TypeOf theControl Is Windows.Forms.Form AndAlso DirectCast(theControl, Windows.Forms.Form).Name <> theForm.Name Then
                CType(theControl, Form).Close()
            End If
        Next
        'theForm.MainForm = Me
        theForm.SuspendLayout()
        theForm.TopLevel = False
        theForm.Dock = DockStyle.Fill
        theForm.FormBorderStyle = Windows.Forms.FormBorderStyle.None
        theForm.Parent = PlayGround
        theForm.Parent.Visible = True

        theForm.Visible = True
        theForm.Show()
        theForm.ResumeLayout()
    End Sub

    Private Sub DueReportToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DueReportToolStripMenuItem.Click
        ShowSubForm(My.Forms.DueReport)
    End Sub

    Private Sub ProvlepomenesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProvlepomenesToolStripMenuItem.Click
        ShowSubForm(My.Forms.Provlepomenes)
    End Sub

    Private Sub StaffToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StaffToolStripMenuItem.Click
        ShowSubForm(My.Forms.Staff)
    End Sub

    Private Sub EktelesthisesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EktelesthisesToolStripMenuItem.Click
        'ShowSubForm(My.Forms.provlepomenes)
    End Sub

    Private Sub DummyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DummyToolStripMenuItem.Click
        ShowSubForm(My.Forms.Employees)
    End Sub

    Private Sub ProgrammatismenesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProgrammatismenesToolStripMenuItem.Click
        ShowSubForm(My.Forms.Programmatismenes)
    End Sub
End Class
